{% extends 'admin/layout.html.twig' %}

{% block body_id 'admin_category_index' %}

{% block main %}
    <h1>{{ 'title.category_list'|trans }}</h1>

    <table class="table table-striped table-middle-aligned">
        <thead>
            <tr>
                <th scope="col">{{ 'label.title'|trans }}</th>
                <th scope="col" class="text-center"><i class="fa fa-cogs" aria-hidden="true"></i> {{ 'label.actions'|trans }}</th>
            </tr>
        </thead>
        <tbody>
        {% for category in categorys %}
            <tr>
                <td>{{ category.cname }}</td>
                {# it's not mandatory to set the timezone in localizeddate(). This is done to
                   avoid errors when the 'intl' PHP extension is not available and the application
                   is forced to use the limited "intl polyfill", which only supports UTC and GMT #}
                <td class="text-right">
                    <div class="item-actions">
                        <a href="{{ path('admin_category_show', {id: category.id}) }}" class="btn btn-sm btn-default">
                            <i class="fa fa-eye" aria-hidden="true"></i> {{ 'action.show'|trans }}
                        </a>

                        <a href="{{ path('admin_category_edit', {id: category.id}) }}" class="btn btn-sm btn-primary">
                            <i class="fa fa-edit" aria-hidden="true"></i> {{ 'action.edit'|trans }}
                        </a>
                    </div>
                </td>
            </tr>
        {% else %}
            <tr>
                <td colspan="4" align="center">{{ 'category.no_posts_found'|trans }}</td>
           </tr>
        {% endfor %}
        </tbody>
    </table>
{% endblock %}

{% block sidebar %}
	{% include 'admin/sidebar.html.twig' %}
	<br>
    {{ parent() }}

{% endblock %}
